package com.extremelylargepackage.entity;

import java.util.LinkedList;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.Log;

import com.extremelylargepackage.GameResources;

public class AiListless implements AiMoveComponent
{
	private Enemy _me;
	private boolean _finished;
	private boolean _needsMove;
	
	public AiListless()
	{
		_needsMove = true;
	}
	
	@Override
	public void performMove(long time)
	{
		if((Math.abs(_me._dirX) < 1 && Math.abs(_me._dirY) < 1) || _needsMove)
		{
			_me._dirY = GameResources.SCREEN_HEIGHT * .25f;
			if(_me._locX > GameResources.SCREEN_WIDTH / 2)
				_me._dirX = 0 - _me._locX;
			else
				_me._dirX = GameResources.SCREEN_WIDTH - _me._locX - _me.getWidth();
			_needsMove = false;
		}
		if(_me._locY >= GameResources.SCREEN_HEIGHT)
		_finished = true;
		
	}
	
	@Override
	public void setSelf(Enemy me) 
	{
		_me = me;
	}
	
	@Override
	public Object clone()
	{
		return new AiListless();
	}
	
	@Override
	public boolean finished()
	{
		return _finished;
	}
}
